'use strict';

angular.module('CBO').controller('ShiftListController', ['$scope', 'BaseModule', 'BaseEnum', '$location', 'Authentication',
    function($scope, BaseModule, BaseEnum, $location, Authentication) {
        BaseModule.initModule($scope, 'Shift');
        $scope.Module.Shift.LoadMode = BaseEnum.LoadMode.CacheAndPaging;
        $scope.Module.Shift.PageSize = 15;

        $scope.btnAdd = function(){
            $location.url('/index/Shift/Edit');
        };

        $scope.rowDblClick = function(){
            $scope.$apply(function(){
                $location.url("/index/Shift/Edit/" + $scope.Module.Shift.FocusedRecord._id);
            });
        };

        $scope.btnDelete = function(){
            $scope.Module.Shift.deleteSelecteds();
        };
    }
]);